PicoOPC User's Guide and Reference
Connecting and Disconnecting

Connection to the OPC UA server is opened by calling the Connect method on the Client object. The connection is closed by calling the Disconnect method on the same Client object. Whether the Client object is currently successfully connected to the OPC UA server can be determined by getting its IsConnected property. You may only call the Connect method when IsConnected is false. You may only call any OPC operation (Read, Write), or the Disconnect method, when IsConnected is true.

The Connect method has one argument, and that is the URL of the server. The only supported scheme is "opc.tcp". Before you call the Connect method, set any parameters that have influence on the connection, such as:

Limitations

An OPC UA client must show some sign of activity to the OPC UA server from time to time, otherwise the server terminates the connection. PicoOPC indicates the requested maximum allowed time without activity to the server, using the value of the SessionTimeout property on the Client object (in milliseconds). The default value of the SessionTimeout is relatively long (1 hour); you can change the value if you need to. PicoOPC does not provide a way to obtain the session timeout as revised by the server, and PicoOPC does not, by itself, provide "additional" activity on the OPC UA connection to keep the session alive. It is responsibility of your code to always make some OPC operation in time, before the session timeout elapses.

PicoOPC ignores the revised lifetime of the security token returned from the OpenSecureChannel OPC UA service. As there is no security with PicoOPC, normally this should not be an issue. If the server limits the lifetime, the developer is responsible for reestablishing a new connection in time.

PicoOPC ignores the maximum response message size indicated by the server (from the CreateSession OPC UA service).  

See Also